export default class CountTimeUnit {
    private _timer:any = -1;
    public start(callback:Function,time:number){
        this.clear();
        this._timer = setInterval(callback,time)
    } 
    public clear(){
        if(this._timer == -1)return;
        clearInterval(this._timer);
        this._timer = -1;
    }

    public get isStart(){
        if(this._timer != -1)return true;
        return false;
    }
}